package com.gzyj.jtt808.v2013.protocol.jtt1078;

import com.gzyj.jtt808.v2013.Package;
import com.gzyj.jtt808.v2013.enums.BusinessDataType;
import io.netty.buffer.ByteBuf;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("实时音视频传输状态通知")
public class JTT808_0x9105 extends Package implements Serializable {
    @ApiModelProperty("通道号")
    public Byte ChannelNo;

    @ApiModelProperty("丢包率")
    public byte DropRate;

    public JTT808_0x9105() {
        super(BusinessDataType.实时音视频传输状态通知.getCode());
    }


    @Override
    public void encodeImpl(ByteBuf buf) {
        buf.writeByte(this.ChannelNo);
        buf.writeByte(this.DropRate);
    }

    @Override
    public JTT808_0x9105 decodeImpl(ByteBuf buf) {
        this.ChannelNo = buf.readByte();
        this.DropRate = buf.readByte();
        return this;
    }
}
